package me.report.mongodb;

import java.util.List;
import me.report.api.mongodb.service.MongoService;
import me.report.mongodb.model.Report;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;

class App {

    public static void main(String[] args) {

        ApplicationContext ctx = new GenericXmlApplicationContext(
                "noSqlApplicationContext.xml");
        MongoService mongoService = (MongoService) ctx.getBean("mongoService");

//		Report report1 = new Report("Report 1", "report so 1", "");
//		Report report2 = new Report("Report 2", "report so 2", "");

//		System.out.println(mongoService.addReport(report1));
//                System.out.println(mongoService.addReport(report2));
        System.out.println(mongoService.deleteAll());
        List<Report> list = mongoService.getAll();
        for (Report r : list) {
            System.out.println(r.toString());

        }
//		System.out.println("Find: " + mongoService.getReportByName("Report 3").toString());
//                Report report3 = new Report("Report 3", "edit report so 1", "c:\\");
//		System.out.println("Edited: " + mongoService.editReportByID("12534f55-028e-4240-b8e2-23e2fb74f7b9", report3));
    }
}
